// 获取布局
// primaryLayout microAppLayout
export function getLayout(pathname) {
  var pathArr = pathname.split('/');
  let appName = null;
  if (pathArr && pathArr.length > 1) {
    appName = pathArr[1];
  }
  if (
    appName == '' ||
    appName == 'workplace' ||
    appName == 'setting' ||
    appName == 'personalInfo'
  ) {
    return 'primaryLayout';
  }
  return 'microAppLayout';
}

// 判断是否是基座路由
export function checkIsMaster(pathname) {
  var pathArr = pathname.split('/');
  var masterPath = '';
  if (pathArr && pathArr.length > 1) {
    masterPath = '/' + pathArr[2];
  }
  var isMater = false;

  if (
    (pathArr && pathArr[1] == 'theme') ||
    (pathArr && pathArr[1] == 'workplace') ||
    (pathArr && pathArr[1] == 'setting') ||
    (pathArr && pathArr[1] == 'personalInfo')
  ) {
    return true;
  }

  // 判断是否是基座路由

  if (masterPath == '/user' || masterPath == '/theme') {
    isMater = true;
  }
  return isMater;
}
